package com.gwsdk.paysdk.acitvityV2;

import android.app.Activity;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.Window;
import android.view.WindowManager;

import com.gwsdk.paysdk.utils.GWInflaterUtils;

public class GWAuthLoginActivity extends Activity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);//去掉信息栏(主要功能就是去除页面弹出时顶部黑色条)
        ComeOutType();
        super.onCreate(savedInstanceState);
        Bundle bundle = getIntent().getExtras();
        if (bundle != null){
            String userId = bundle.getString("userId");
            String phone = bundle.getString("phone");
            String authLogin ="com.gwwan.com.auth.login";
            Intent intent=new Intent(authLogin);
            intent.putExtra("userId",userId);
            intent.putExtra("phone",phone);
            sendBroadcast(intent);
            finish();
        }
    }

    private void ComeOutType() {
        Window window = getWindow();
        window.requestFeature(Window.FEATURE_NO_TITLE);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            //透明状态栏
            window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        }
        window.setDimAmount(0f); //设置背景透明度   0~1
        overridePendingTransition(GWInflaterUtils.getIdByName(this,"anim","gw_scale_in"),0);
    }
}
